<%@ page language="java" contentType="text/html; charset=ISO-8859-1" import="java.sql.*,java.util.ArrayList,java.util.List,org.adg.code.model.*;"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<Script Language="JavaScript">  
function setvalue(rval,hname)
{
var obj=document.getElementById(hname);
obj.value=rval;
}
</Script>  
</head>
<body>
<table id="multipleRangeTable" width="484" height="30" border="0" align="center" cellpadding="2" cellspacing="3">
      
      <%
      
      NewReportReturn nrr=(NewReportReturn)request.getAttribute("nrr");
      ArrayList rptname=nrr.getRptName();
      ArrayList uitypes=nrr.getuitype();
      ArrayList rpt=nrr.getrptid();
      TemplateMultiValues[] tmv=nrr.getTmv();
      
      int len=uitypes.size();
      String n="value";
      String lb="label";String s="";String rid="";String nm="";
      int r=0;
      	for(int i=0,j=1;i<len;i++,j++)
      { 	n="value";lb="label";
      n=n+j;lb=lb+j; 
      s=(String)uitypes.get(i);
      rid=(String)rpt.get(i);
 //     r=Integer.parseInt();
      nm=(String)rptname.get(i);
      %>
      <tr>
      <td width="237" class="style1"><input type="hidden" id="<%=lb%>" name="<%=lb%>" value="<%=rid%>"/><div align="right"><%=nm%> : </div></td>
        <td width="312"><div align="left"><%if(s.equalsIgnoreCase("textbox")){ %> 
         <input type="text" id="<%=n%>" name="<%=n%>" value=""/>
         <%}
         else if(s.equalsIgnoreCase("password")){%>
         <input type="password" id="<%=n%>" name="<%=n%>" value=""/>
         <%}
         else if(s.equalsIgnoreCase("textarea")){%>
         <textarea id="<%=n%>" name="<%=n%>"></textarea>
         <%}
         else if(s.equalsIgnoreCase("date")){%>
         <input type="text" id="<%=n%>" name="<%=n%>" value=""/>
         <IMG src="images/cal.gif" height=18 width=18 border=0 alt="Calendar" onClick="javascript:displayDatePicker('<%=n%>',this);">  
         <%}
         else if(s.equalsIgnoreCase("Selectbox")){%>
         <select id="<%=n%>" name="<%=n%>">
          <option>---select---</option>
          <% 
	List ls=tmv[i].getList();
		
		for(int k=0;k<ls.size();k++)
		{
			String val=(String)ls.get(k);
		
		%>
			<option value="<%=val%>"><%=val%></option>
		<%}%>
		</select>
	    <%}
	    else if(s.equalsIgnoreCase("Radiobutton")){%>
	    	<input type="hidden" id="<%=n%>" name="<%=n%>" value=""/>
	   <% List ls=tmv[i].getList();
		String radioname="radiogroup"+i;
		for(int k=0;k<ls.size();k++)
		{
			String val1=(String)ls.get(k);
		%>
	    <input type="radio" id="<%=radioname%>" name="<%=radioname%>" value="<%=val1%>" onclick="setvalue('<%=val1%>','<%=n%>')"><%=val1 %><br>
	    <%}}%>
        </div></td> 
      </tr>
      <%}%>
    </table>
    <input type="hidden" id="numoffields" name="numoffields" value="<%=len %>"/>
</body>
</html>